<template>
<div>
    <Phead />
      <!-- 中标人提示消息 -->
    <div class="w">
        <div class="personal-message">
            <div class="swiper-container swiper-container2">
                <div class="swiper-wrapper">
                    <div class="swiper-slide">
                        恭喜服务者董先生竞标医用听诊器成功！中标时间1天12分钟！<span>2019-05-24 13:55:13</span>
                    </div>
                    <div class="swiper-slide">
                        恭喜服务者董先生竞标医用听诊器成功！中标时间1天12分钟！<span>2019-05-24 13:55:13</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="personal-content w clearfix">

        <!-- 个人中心左侧切换 -->

        <div class="left">
            <div class="name">
                <router-link :to="userInfo? '':'/register/login'">
                      <img src="@/assets/img/touxiang.png" alt="" v-if='userInfo' />
                      <img src="@/assets/img/touxiang.png" alt="" v-else />
                    
                      <p v-if='userInfo' >{{userInfo.user_nickname}}</p>
                      <p v-else>登录/注册</p>

                      <span v-if='userInfo'>
                        {{biding_num_text}}：{{biding_num}}
                      </span>
                      <span v-else>
                        招标中：0
                      </span>
                      <span v-if='userInfo'>
                        {{enlist_num_text}}：{{enlist_num}}
                      </span>
                      <span v-else>
                         已投：0 
                      </span>

                 </router-link >
                
            </div>
            <div class="personal-menus">
                <ul>
                    <li>
                        <p class="personal-menus1 active"><span>我的订单</span></p>

                    </li>
                    <li>
                        <p class="personal-menus2"><span>消息中心</span></p>
                    </li>
                    <li>
                        <p class="personal-menus3"><span>身份认证</span></p>
                    </li>
                    <li>
                        <p class="personal-menus4"><span>成为合伙人</span></p>
                    </li>
                    <li>
                        <p class="personal-menus5"><span>修改密码</span></p>
                    </li>
                    <li>
                        <p class="personal-menus6"><span>医竞采协议</span></p>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 个人中心内容 -->

        <div class="right myorder">
            <!-- 个人中心tab切换栏 -->
            <h3 class="stamp">我的订单</h3>
            <ul class="change clearfix">
                <li class="active">招标中</li>
                <li>已中标</li>
                <li>未中标</li>
                <li>报价人数不足</li>
                <li>效益作废</li>
                <li>拒收</li>
                <li>等待确认结果</li>
                <li>成交</li>
            </ul>

            <!-- 个人中心 -->
            <div class="tabulation">

                <!-- 个人中心 > 我的订单 > 招标中 -->
                <div class="ul1 item">
                    <ul>
                        <li>
                            <a href="">
                                <span>(医疗器械)</span><em>医疗器械采购机器</em><i class="fr"><em></em>北京市东城区</i>
                                <h4>招标项目需求简介，需要大量采购，请尽快联系我。招标项目需求简介，需要大量采购，请尽快联系我。招尽快联系我。招标项目需求简介，需快联系 尽快联系我。招标项目需求简要采购标
                                    ...
                                </h4>
                                <tbody>
                                    <table>
                                        <tr>
                                            <td class="green"><span>09-28</span></td>
                                            <td><em>北京*******公司</em></td>
                                            <td><em>10人</em></td>
                                        </tr>
                                        <tr>
                                            <td>时间</td>
                                            <td>发布者</td>

                                            <td>竞标</td>
                                        </tr>
                                    </table>
                                </tbody>
                            </a>
                        </li>
                        
                    </ul>
                    <div class="clearfix">
                        <div class="page">
                            <a href="" class="active">上一页</a>
                            <a href="">1</a>
                            <a href="">2</a>
                            <a href="">3</a>
                            <a href="">4</a>
                            <a href="">5</a>
                            <a href="">下一页</a>
                            <i>跳转到<input type="text">页</i>
                        </div>
                    </div>
                </div>

                <!-- 个人中心 > 我的订单 > 已中标 -->
                <div class="ul2 item">
                    <ul>
                        <li>
                            <a href="">
                                <span>(医疗器械)</span><em>医疗器械采购机器</em><button>确认</button><i class="fr"><em></em>北京市东城区</i>
                                <h4>招标项目需求简介，需要大量采购，请尽快联系我。招标项目需求简介，需要大量采购，请尽快联系我。招尽快联系我。招标项目需求简介，需快联系 尽快联系我。招标项目需求简要采购标
                                    ...
                                </h4>
                                <tbody>
                                    <table>
                                        <tr>
                                            <td class="green"><span>09-28</span></td>
                                            <td><em>北京*******公司</em></td>
                                            <td><em>10人</em></td>
                                        </tr>
                                        <tr>
                                            <td>时间</td>
                                            <td>发布者</td>

                                            <td>竞标</td>
                                        </tr>
                                    </table>
                                </tbody>
                            </a>
                        </li>
                       
                    </ul>
                    <div class="clearfix">
                        <div class="page">
                            <a href="" class="active">上一页</a>
                            <a href="">1</a>
                            <a href="">2</a>
                            <a href="">3</a>
                            <a href="">4</a>
                            <a href="">5</a>
                            <a href="">下一页</a>
                            <i>跳转到<input type="text">页</i>
                        </div>
                    </div>
                </div>

                <!-- 个人中心 > 我的订单 > 未中标 -->
                <div class="ul3 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

                <!-- 个人中心 > 我的订单 > 报价人数不足 -->
                <div class="ul4 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

                <!-- 个人中心 > 我的订单 > 效益作废 -->
                <div class="ul5 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

                <!-- 个人中心 > 我的订单 > 拒收 -->
                <div class="ul6 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

                <!-- 个人中心 > 我的订单 > 等待确认结果 -->
                <div class="ul7 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

                <!-- 个人中心 > 我的订单 > 成交 -->
                <div class="ul8 null item">
                    <img src="@/assets/img/NULL.png" alt="">
                </div>

            </div>
        </div>

    </div>

    <Pfoot />
</div>


 <!--  <div class="wrap w-my" id="app">
    
    <section class="order">
        <p class="tit">我的订单</p>
        <div class="items clearfix">
            <div class="item" @click="toDidlist(0)">
                    <img src="@/assets/img/my_menus1.png" alt="" />
                    <p>招标中</p>
            </div>
            <div class="item" @click="toDidlist(1)">
                    <img src="@/assets/img/my_menus2.png" alt="" />
                    <p>已中标</p>
            </div>
            <div class="item" @click="toDidlist(2)">
                    <img src="@/assets/img/my_menus3.png" alt="" />
                    <p>未中标</p>
            </div>
            <div class="item" @click="toDidlist(3)">
                    <img src="@/assets/img/my_menus4.png" alt="" />
                    <p>报价人数不足</p>
            </div>
            <div class="item" @click="toDidlist(4)">
                    <img src="@/assets/img/my_menus5.png" alt="" />
                    <p>效益作废</p>
            </div>
            <div class="item" @click="toDidlist(5)">
                    <img src="@/assets/img/my_menus6.png" alt="" />
                    <p>拒收</p>
            </div>
            <div class="item" @click="toDidlist(6)">
                    <img src="@/assets/img/my_menus7.png" alt="" />
                    <p>等待确认结果</p>
            </div>
            <div class="item" @click="toDidlist(7)">
                    <img src="@/assets/img/my_menus8.png" alt="" />
                    <p>成交</p>
            </div>
        </div>
    </section>
    <ul class="lists">
        <li @click="toAuth">
                认证
                <img class="icon" src="@/assets/img/r_b.png" alt="" />
        </li>
        <li @click="toEditpass">
                修改密码
                <img class="icon" src="@/assets/img/r_b.png" alt="" />
        </li>
      
        <li class="friend" @click="toInviteman">
                成为合伙人
                <img class="icon" src="@/assets/img/r_b.png" alt="" />
        </li>
        <li @click="outLogin">
                退出登录
        </li>
    </ul>
    <Bartab />

</div> -->

</template>

<script>
// @ is an alias to /src
import Phead from '@/components/Phead.vue'
import Pfoot from '@/components/Pfoot.vue'
import Swiper from 'swiper';

export default {
  name: 'my',
  // inject:['reload'],
  data(){
    return{
        userInfo:null,
        headImg:null,

        biding_num_text:'招标中',
        enlist_num_text:'已投',
        biding_num:0,
        enlist_num:0
          
     }
  },
  async created(){
       this.userInfo = this.getUserInfo()
       let re = await this.$axios.get('user/myInit')
       if(re.code == 200){
              this.biding_num = re.data.biding_num
              this.enlist_num = re.data.enlist_num
              this.biding_num_text = re.data.biding_num_text
              this.enlist_num_text = re.data.enlist_num_text

          }
  },

  mounted(){
     
            
  },
  components: {
      Phead,
      Pfoot
  },
  methods:{
    //去标书列表
    toDidlist(id){
        this.$router.push({path:'/my/bidlist',query: {
            id:id
        }})
        
    },
    //去认证
    async toAuth(){
       let user = await this.$axios.get('user/getUserByToken')
        if(user.code == 200){
              if(user.data.user_type ==0){
                this.$router.push({path:'/register/status'})
                 
              }else{
                 this.$router.push({path:'/my/usertype'})
               
              }
          
           }
    },
    //去关于我们
    toAbout(){
        this.$router.push({path:'/my/about'})
 
    },
    //修改密码
    async toEditpass(){
       let user = await this.$axios.get('user/getUserByToken')
        if(user.code == 200){
              if(user.data.user_type ==0){
                this.$router.push({path:'/register/status'})
                 
              }else{
                 this.$router.push({path:'/my/editpass'})
               
              }
          
           }

    },
    //成为合伙人
    async toInviteman(){
    let user = await this.$axios.get('user/getUserByToken')
        if(user.code == 200){
             if(user.data.is_invite ==0){

                this.$createDialog({
                    type: 'confirm',
                    icon: '',
                    title: '提示',
                    content: '成为合伙人,生成邀请码,可推荐同行入驻,赢取返利!',
                    onConfirm: () => {
                       let re =  this.$axios.post('user/goInvite')
                       .then(response => {
                           if(response.code == 200){
                              this.$router.push({path:'/my/inviteman'})
                            }
                       })
                           
                     },
                  }).show()

              }else{
                 this.$router.push({path:'/my/inviteman'})
               
              }
          
         }
              
    },
    gologin(){
        this.$router.push({path:'/register/login'})
    },
    
  }
}
</script>

